<template>
  <div v-show="show">
    <div class="mask"></div>
    <div class="alert">
      <div class="alert-content">
        {{alertText}}
      </div>
      <div class="alert-btn">
        <button v-on:click="yes">{{alertBtnText}}</button>
        <p v-show="false">{{alertUrl}}</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      show: true
    }
  },
  methods: {
    yes: function () {
      this.show = false
      console.log(this.alertUrl)
      this.$router.push({
        path: this.alertUrl,
        params: ''
      })
    }
  },
  props: ['alertText', 'alertBtnText', 'alertUrl']
}
</script>

<style scoped>
  .mask {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: .5;
    position: absolute;
    background-color: #000; }
  .alert {
    width: 90%;
    height: 4.0rem;
    border: 0.027rem solid #000;
    text-align: center;
    position: absolute;
    left: 5%;
    top: 25%;
    background-color: #fff;
    border-top: 0.213rem solid #FF6600; }
  .alert .alert-content {
    font-size: 0.48rem;
    margin-top: 0.8rem;
    padding: 0 0.8rem 0 0.8rem; }
  .alert .alert-btn {
    margin-top: 0.8rem; }
  .alert .alert-btn button {
    border: 0.027rem solid #FF6600;
    border-radius: 0.133rem;
    height: 1.067rem;
    background-color: #fff;
    line-height: 1.067rem;
    padding: 0 0.8rem 0 0.8rem;
    font-size: 0.427rem;
    font-family: "microsoft yahei"; }
</style>
